<?php
/**
 * classe que representa os lances dos clientes no leilao
 * @access public
 * @author Magno Leal
 * @package model
 */
class LanceBean {

    private $lanceID;
    private $data;
    private $usuario;
    private $leilao;

    function __construct($lanceID = 0, $data = "", $usuario = null, $leilao = null) {
        $this->lanceID = $lanceID;
        $this->data = $data;        
        $this->usuario = $usuario;
        $this->leilao = $leilao;
    }

    public function getLanceID() {
        return $this->lanceID;
    }

    public function setLanceID($lanceID) {
        $this->lanceID = $lanceID;
    }

    public function getData() {
        return $this->data;
    }

    public function setData($data) {
        $this->data = $data;
    }
    
    public function getUsuario() {
        return $this->usuario;
    }

    public function setUsuario($usuario) {
        $this->usuario = $usuario;
    }

    public function getLeilao() {
        return $this->leilao;
    }

    public function setLeilao($leilao) {
        $this->leilao = $leilao;
    }

    public function toJson() {
        return json_encode($this->toBD());
    }

    public function toBD() {
        $lance = array();

        $lance['lanceID'] = $this->lanceID;
        $lance['data'] = $this->data;
        $lance['usuarioID'] = $this->usuario->getUsuarioID();
        $lance['leilaoID'] = $this->leilao->getLeilaoID();

        return $lance;

    }
}
?>
